/* eslint-disable */
import request from '@/utils/request'

// 我的订单列表
export function orderLists(params) {
  return request({
    url: '/trades',
    method: 'get',
    params
  })
}

// 订单详情
export function orderDetail(params) {
  return request({
    url: '/trades/' + params.trade,
    method: 'get'
  })
}

// 删除订单
export function delOrder(data) {
  return request({
    url: '/trades/' + data.trade,
    method: 'DELETE'
  })
}

// 关闭订单
export function closeOrder(params) {
  return request({
    url: '/trades/' + params.trade + '/close',
    method: 'DELETE'
  })
}

// 确认收货
export function reveiveOrder(params) {
  return request({
    url: '/trades/' + params.trade + '/receive',
    method: 'post'
  })
}

// 修改价格
export function priceOrder(data) {
  return request({
    url: '/trades/' + data.trade + '/modify/price',
    method: 'PUT',
    data
  })
}

// 获取导出订单URL
export function getExportUrl(params) {
  return request({
    url: '/shop/mp/trades/export',
    method: 'get',
    params
  })
}

// 拉取快递公司
export function getExpressCompany() {
  return request({
    url: '/expresses',
    method: 'get'
  })
}

// 标记发货
export function markDeliver(params) {
  return request({
    url: `/trades/${params.trade}/deliver`,
    method: 'PUT',
    params
  })
}

// 查看物流
export function showExpress(params) {
  return request({
    url: `/shop/trades/${params.trade}/express`,
    method: 'get'
  })
}

// 售后列表
export function refundapplylist(params) {
  return request({
    url: '/trades/refund/apply/list',
    method: 'get',
    params
  })
}

// 售后详情
export function refunddetail(params, otherData) {
  return request({
    url: `/trades/refund/apply/${otherData.apply_id}/detail`,
    method: 'get',
    params
  })
}

// 售后审核
export function refundcheck(data) {
  return request({
    url: `/trades/refund/apply/${data.apply_id}/audit`,
    method: 'put',
    data
  })
}

// 售后实际退款金额修改
export function refundactual(data) {
  return request({
    url: `/trades/refund/apply/${data.apply_id}/actual`,
    method: 'put',
    data
  })
}
// 在线核销
export function setOff(params = {}) {
  return request({
    url: '/trades/pickup/list',
    method: 'get',
    params
  })
}
// 核销记录
export function offRecord(params) {
  return request({
    url: '/trades/pickup/log',
    method: 'get',
    params
  })
}
// 确认核销
export function confirmOff(params) {
  return request({
    url: `/trades/${params.order_id}/receive`,
    method: 'PUT'
  })
}

// 订单核销记录导出Excel
export function stafflistexport(params) {
  return request({
    url: `/shop/mp/verification/export`,
    method: 'get',
    params
  })
}

// 物流快递信息
export function checklogisticsDetail(params) {
  return request({
    url: `/trades/${params.trade}/express`,
    method: 'get'
  })
}

// 物流快递信息
export function getShipperList(params) {
  return request({
    url: `/trades/shipperList`,
    method: 'get',
    params
  })
}
